<template>
    <div class="warp-main">
        <el-col class="table-wrapper">
				<el-table :data="tableData" stripe style="width: 100%" >
					<el-table-column prop="project_info_id" label="项目ID"></el-table-column>
					<el-table-column prop="project_name" label="项目名称"></el-table-column>
					<el-table-column prop="project_tip" label="项目简介" ></el-table-column>
					<el-table-column prop="project_content" label="项目详细内容"></el-table-column>
					<el-table-column prop="company_id" label="申报单位ID"></el-table-column>
                    <el-table-column prop="company_user_id" label="项目申报者ID"></el-table-column>
                    <el-table-column prop="project_reason" label="参选理由"></el-table-column>
                    <el-table-column prop="project_time" label="申报时间"></el-table-column>
                    <el-table-column label="操作">
						<template slot-scope="scope">
                            <el-input v-model="c" placeholder="请打分"></el-input>
							<el-button
								type="text"
								class="red"
								@click="countutil(c, scope.row)"
							>提交</el-button>
						</template>
					</el-table-column>
				</el-table>
		</el-col>
    </div>
</template>

<script>
export default {
	name: "mission",
	data() {
		return {

            Info:{
                project_info_id:'',
                count: 5,
                },

            tableData: [],
            c:8	
		};
	},			
				
	mounted() {
		//初始化
		console.log("初始化");
		// var data=await this.$http.post('/getallcompanyluserlist');
		this.getprojectinfo().then(res => {
			this.tableData = res.data
			console.log(this.tableData)
			})
	
	},
    // addprojectreviewinfo
	methods: {
		async getprojectinfo() {
			var data=await this.$http.get('/getprojectinfo');
			return data
		},
         async countutil(count, row) {			
                await this.addinfoHandler(count, row);			    
		    },
            change(value, render) {
			this.html = render;
		    },
            change(e){
                this.$forceUpdate();
            },
            async addinfoHandler(count, row){
                console.log(row.project_info_id,count)
                this.Info.project_info_id=row.project_info_id;
                this.Info.count=this.c;
                var data = await this.$http.post(getprojectinfo,JSON.stringify(this.Info));
                
                if(data.state=200){
                    //提交成功
                    this.$message.success(data.message);
                }else{
                    this.$message.error(data.message);
                    return;
                }
            
        }
	}
}
</script>